package work.mediway.mdm.biz.entity.biz;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 数据质量对比结果
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/7/12
 */
@ApiModel(value = "数据质量对比结果")
@Data
@TableName(value = "SS_Data_Quality_Log")
public class SsDataQualityLog implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    private Long id;

    /**
     * 配置关联id
     */
    @TableField(value = "data_quality_config_id")
    @ApiModelProperty(value = "配置关联id")
    private Long dataQualityConfigId;

    /**
     * 源系统数量
     */
    @TableField(value = "source_system_count")
    @ApiModelProperty(value = "源系统数量", hidden = true)
    private Long sourceSystemCount;

    /**
     * 目标系统数量
     */
    @TableField(value = "target_system_count")
    @ApiModelProperty(value = "目标系统数量", hidden = true)
    private Long targetSystemCount;

    /**
     * 缺失数据唯一值集合
     */
    @TableField(value = "missing_data_value")
    @ApiModelProperty(value = "缺失数据唯一值集合", hidden = true)
    private String missingDataValue;

    /**
     * 数据错误唯一值集合
     */
    @TableField(value = "error_data_value")
    @ApiModelProperty(value = "数据错误唯一值集合", hidden = true)
    private String errorDataValue;

    /**
     * 起始时间点
     */
    @TableField(value = "start_date")
    @ApiModelProperty(value = "起始时间点", hidden = true)
    private String startDate;

    /**
     * 截止时间点
     */
    @TableField(value = "end_date")
    @ApiModelProperty(value = "截止时间点", hidden = true)
    private String endDate;

    /**
     * 更新时间
     */
    @TableField(value = "update_date")
    @ApiModelProperty(value = "更新时间", hidden = true)
    private String updateDate;

    /**
     * 更新人
     */
    @TableField(value = "update_user")
    @ApiModelProperty(value = "更新人", hidden = true)
    private String updateUser;

    /**
     * 数据质量比对类型
     */
    @TableField(value = "quality_type")
    @ApiModelProperty(value = "数据质量比对类型")
    private String qualityType;

    /**
     * 对应表名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "对应表名称")
    private String targetTableCode;

    /**
     * 对应表名称描述
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "对应表名称描述", hidden = true)
    private String targetTableDesc;

    /**
     * 对应表名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "对应表名称")
    private String sourceTableCode;

    /**
     * 对应表名称描述
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "对应表名称描述", hidden = true)
    private String sourceTableDesc;

    @TableField(exist = false)
    @ApiModelProperty(value = "对比差值", hidden = true)
    private Integer diffCount;

    @TableField(exist = false)
    @ApiModelProperty(value = "开始比对日期")
    private String startComparisonDate;

    @TableField(exist = false)
    @ApiModelProperty(value = "结束比对日期")
    private String endComparisonDate;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否有差值", allowableValues = "Y,N")
    private String diffValueFlag;

    @TableField(exist = false)
    @ApiModelProperty(value = "日志详情")
    private List<SsDataQualityLogItem> dataQualityLogItems = CollUtil.newArrayList();

    @Data
    public static class DataQualityErrorVO {

        private Object uniqueValue;

        private Object data;

        private String msg;
    }
}